// 填写说明
var explain = Vue.extend({
	template:'<div class="explain-box"><div style="text-align:center;">提示：关键提醒文字位置，请点击<span class="explain-link" @click="showDialog()">填写说明</span>查看详情</div><div v-if="isShowDialog" class="explain-dialog"><div class="explain-in"><div class="explain-header">{{headertxt}}</div><div class="explain-con"><div class="explain-con-title">填写说明/功能说明</div><div class="explain-con-txt" id="explain"></div><div class="explain-con-title">重点描述或业务规则说明</div><div class="explain-con-txt" id="rec"></div><div class="explain-con-title">附件信息</div><div v-for="(item,index) in fileList" class="explain-con-file">{{item.fileName}}</div></div><div class="explain-btn" @click="close">关闭</div></div></div></div>',
	data () {
		return {
			isShowDialog:false,
			explain:'', // 填写说明/功能说明
			rec:'', // 重点描述或业务规则说明
			fileList:[]
		}
	},
	props : {
		headertxt:'', 
		explainquery:''
	},
	methods: {
		// 显示弹框
		showDialog () {
			this.isShowDialog = true;
			this.queryData()
		},
		// 关闭弹出框
		close () {
			this.isShowDialog = false;
		},
		// 获取数据
		queryData () {
			let param = {
				"menuCode": this.explainquery
			}
			let _this = this
			mui.neiosRequst.httpRequst('/app/common/getFillingExplanByMod', param,
				function(data) {
					if (data.code == '0') {
						$('#explain').append(data.data.neiosFillingExplan.fillContext)
						$('#rec').append(data.data.neiosFillingExplan.fillContext)
						if (data.data.attachIds != '' && data.data.attachIds != null && data.data.attachIds != undefined) {
							let fileParams = {
								fileIds:data.data.attachIds
							}
							mui.neiosRequst.httpRequst('/app/common/getFileList', fileParams,
								function(data) {
									_this.fileList = data.data
								},
								function() {
									
								}
							);
						}
					} else {
						$('#explain').append('')
						$('#rec').append('')
						_this.fileList = []
						mui.toast('请稍后重试！')
					}
				},
				function() {
					$('#explain').append('')
					$('#rec').append('')
					_this.fileList = []
					mui.toast('请稍后重试！')
				}
			);
		}
	}
})